package com.youkeyi.ddy.cloud.common.api.application.system.auth;

import com.youkeyi.ddy.cloud.common.api.application.system.auth.dto.SystemAuthListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.auth.param.*;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 系统接口权限
 *
 * @Author liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【SYSTEM】auth management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-SYSTEM", fallback = SystemAuthCloudServiceFallback.class)
@RequestMapping("/system/auth")
public interface SystemAuthCloudService {

    // 查询接口权限列表
    @ApiOperation(value = "Query System Auth List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.auth.SystemAuthCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemAuthListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Auth List", dataType = "SystemAuthListCloudParam", dataTypeClass = SystemAuthListCloudParam.class),
    })
    @GetMapping
    public abstract SystemAuthListCloudDto list(SystemAuthListCloudParam param);

    // 创建权限
    @ApiOperation(value = "Create System Corp", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.auth.SystemAuthCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create System Corp", dataType = "SystemAuthCreateCloudParam", dataTypeClass = SystemAuthCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody SystemAuthCreateCloudParam param);


    // 编辑权限
    @ApiOperation(value = "Update System Corp", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.auth.SystemAuthCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update System Corp", dataType = "SystemAuthUpdateCloudParam", dataTypeClass = SystemAuthUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody SystemAuthUpdateCloudParam param);


    // 删除权限
    @ApiOperation(value = "Delete System Corp", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.auth.SystemAuthCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete System Corp", dataType = "SystemAuthDeleteCloudParam", dataTypeClass = SystemAuthDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(SystemAuthDeleteCloudParam param);

}
